from flask import Flask, render_template

app = Flask(__name__)

# 配置文件，config_flask文件下的settings文件
# 注意此py文件须于config文件在同级目录
app.config.from_object("config_flask.settings.DevSettings")
print(app.config["DB_HOST"])
app.config.from_object("config_flask.settings.ProdSettings")
print(app.config["DB_HOST"])


@app.route("/")
def index():
    return "hello world"


if __name__ == "__main__":
    app.run()


"""
1. 程序启动，等待用户请求到来
    app.run()

2. 用户请求到来 app()
    app.__call__

"""
